package com.contract.spirit.bean.entity

import android.view.View
import androidx.annotation.Keep
import com.contract.spirit.R
import com.contract.spirit.ui.main.first.adapter.FirstPageRankAdapter
import java.io.Serializable

/**
 * @author zhengjun
 * @desc
 * @create at 2021/6/19 10:52
 */
@Keep
data class RankInfo(
    var phone: String? = null,
    var count: String? = null,
    var amount: String? = null,
    var adapterPosition: Int = 0,
    var rankType: String? = null
) : Serializable{
    fun isCompensated(): Boolean {
        return rankType.equals(FirstPageRankAdapter.COMPENSATED)
    }

    fun showIcon(): Boolean {
        return adapterPosition == 0 || adapterPosition == 1 || adapterPosition == 2

    }
    fun getRankIcon(): Int {
        when (adapterPosition) {
            0 -> {
                return R.mipmap.icon_rank1
            }
            1 -> {
                return R.mipmap.icon_rank2
            }
            else -> {
                return R.mipmap.icon_rank3
            }
        }
    }
}